{% extends 'base.html' %}
{% load static %}
{% block main %}

<article> 
    <!-- 轮播图 -->
    {% include 'include/carousel.html' %}

    <div class="clearblank"></div>

    <!-- 专题板块 -->
    {% include 'include/zhuanti.html' %}

    <div class="whitebg bloglist">
      <h2 class="htitle">最新博文</h2>
      <ul>
          {% for article in new_article|slice:":10" %}
            <li>
                {% if article.is_top %}
                    <h3 class="blogtitle"><a href="{% url 'blog:article' article.id %}" target="_blank"><b>【顶】</b>{{ article.title }}</a></h3>
                {% else %}
                    <h3 class="blogtitle"><a href="{% url 'blog:article' article.id %}" target="_blank">{{ article.title }}</a></h3>
                {% endif %}
                {% if article.is_original %}
                    <span class="blogpic imgscale"><i><a>原创文章</a></i><a href="{% url 'blog:article' article.id %}" title=""><img src="{{ article.img.url }}" alt=""></a></span>
                {% else %}
                    <span class="blogpic imgscale"><a href="{% url 'blog:article' article.id %}" title=""><img src="{{ article.img.url }}" alt=""></a></span>
                {% endif %}

              <p class="blogtext">{{ article.summary }} </p>
              <p class="bloginfo"><i class="avatar"><img src="{{ article.author.avatar.url }}"></i><span>{{ article.author.username }}</span><span>{{ article.pub_time }}</span><span>{% for tag in article.tag.all %}【<a href="{% url 'blog:tag' tag %}">{{ tag }}</a>】{% endfor %}</span></p>
              <a href="{% url 'blog:article' article.id %}" class="viewmore">阅读更多</a> </li>
          {% endfor %}
      </ul>
    </div>
    <!--bloglist end--> 
  </div>
  <div class="rbox">
    <!-- 个人名片 -->
      {% include 'include/card.html' %}
    <div class="whitebg notice">
      <h2 class="htitle">网站公告</h2>
      <ul>
          {% for notice in notice_list|slice:":5" %}
              <li><a href="{% url 'blog:article' notice.id %}">{{ notice.title }}</a></li>
          {% endfor %}
      </ul>
    </div>
    {% include 'include/click_rank.html' %}
    {% include 'include/recommend.html' %}
    {% include 'include/siteinfo.html' %}
    <div class="links whitebg">
      <h2 class="htitle"><span class="sqlink"><a href="/">申请链接</a></span>友情链接</h2>
      <ul>
          {% for link in links %}
            <li><a href="{{ link.url }}" target="_blank">{{ link.title }}</a></li>
          {% endfor %}
      </ul>
    </div>
  </div>
</article>
{% endblock %}
